package com.heima.wemedia.wemediaController;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wenmedia.pojos.WmUser;
import com.heima.wemedia.service.Wemdiaservice;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/user")
@Api(value = "自媒体API",tags = "用户管理API")
public class WemdiaController {

    @Autowired
    private Wemdiaservice wemdiaservice;
    @GetMapping("/findByName/{name}")
    public ResponseResult<WmUser> findname(@PathVariable("name") String name){
        return wemdiaservice.findbyname(name);
    }
    @PostMapping("save")
    public ResponseResult<WmUser> savewm(@RequestBody WmUser wmUser){
        return wemdiaservice.wemsave(wmUser);
    }



}
